<?php
require_once("/../eventHelper.php");
require_once("/../databaseHelper.php");
require_once("/../resetDatabase.php");

class eventHelperTest extends PHPUnit_Framework_TestCase
{
	public function testGetUpcomingEvents()
	{
		$upcomingEvents = eventHelper::getUpcomingEvents();
		
		$firstEvent = Array('USER_ID'=>'8', 'NAME'=>'Humans vs Zombies',
		'DESCRIPTION'=>'Brains!!!!!!!!!  Human vs Zombies is back!  Will you survive?',
		'LOCATION'=>'Engineering Center', 'HOSTED_BY'=>'HvZ',
		'LINK'=>'http://www.cuhvz.com/home.php',
		'IMAGE_PATH'=>'http://nozombiesallowed.files.wordpress.com/2009/08/cropped-hvz3_021.jpg',
		'START_TIME'=>'2011-12-05 08:00:00', 'END_TIME'=>'2011-12-07 23:00:00');
		
		$this->assertEquals($upcomingEvents['5'], $firstEvent);
	}
	
	public function testGetUsersUpcomingEvents()
	{
		$upcomingEvents = eventHelper::getUsersUpcomingEvents(1);
		
		$firstEvent = Array('USER_ID'=>'8', 'NAME'=>'Humans vs Zombies',
				'DESCRIPTION'=>'Brains!!!!!!!!!  Human vs Zombies is back!  Will you survive?',
				'LOCATION'=>'Engineering Center', 'HOSTED_BY'=>'HvZ',
				'LINK'=>'http://www.cuhvz.com/home.php',
				'IMAGE_PATH'=>'http://nozombiesallowed.files.wordpress.com/2009/08/cropped-hvz3_021.jpg',
				'START_TIME'=>'2011-12-05 08:00:00', 'END_TIME'=>'2011-12-07 23:00:00');
		
		$this->assertEquals($upcomingEvents['5'], $firstEvent);
	}
	
	public function testGetUsersAllEvents()
	{
		$allEvents = eventHelper::getUsersAllEvents(1);
		
		$firstEvent = Array('USER_ID'=>'8', 'NAME'=>'Humans vs Zombies',
						'DESCRIPTION'=>'Brains!!!!!!!!!  Human vs Zombies is back!  Will you survive?',
						'LOCATION'=>'Engineering Center', 'HOSTED_BY'=>'HvZ',
						'LINK'=>'http://www.cuhvz.com/home.php',
						'IMAGE_PATH'=>'http://nozombiesallowed.files.wordpress.com/2009/08/cropped-hvz3_021.jpg',
						'START_TIME'=>'2011-12-05 08:00:00', 'END_TIME'=>'2011-12-07 23:00:00');
		
		$this->assertEquals($allEvents['5'], $firstEvent);
	}
	
	public function testGetUpcomingEventsWithTag()
	{
		$taggedEvents = eventHelper::getUpcomingEventsWithTag(7);
		$firstEvent = eventClass::getEventDetails(2);
		unset($firstEvent['TAGS']);
		$firstEvent['TAGS'] = Array('2'=>'Computer Science');
		
		$this->assertEquals($taggedEvents['2'], $firstEvent);
	}
	
	public function testGetUserRecomEvents3()
	{
		$recommendedEvents = eventHelper::getUserRecomEvents(1);
		$firstEvent = eventClass::getEventDetails(1);
		
		$this->assertEquals($recommendedEvents['1'], $firstEvent);
	}
	
	public function testGetUserRecomEvents0()
	{
		$recommendedEvents = eventHelper::getUserRecomEvents(13);
		$firstEvent = eventClass::getEventDetails(5);
		
		$this->assertEquals($recommendedEvents[5], $firstEvent);
	}
}

?>